package com.lmxdawn.api.dnf.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.StringSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * order实体类
 * @author
 *
 */
@TableName("t_orders")
@Data
public class Order implements Serializable {
	@JsonSerialize(using = ToStringSerializer.class)
	@JSONField(serializeUsing = StringSerializer.class)
	private String id;//订单id
	private String userId;//用户id
	// 1、自营 2、代理
	// 3、商城回收的价格维护
	// 4、出售给商城 卖金币给商城
	// 11 12 特价 500-5000 回收出售
	// 13 14 5000+ 回收出售
	// 3  12 14   出售 给商城
	// 1 11 13  购买 商城
	private Integer type;
	/**
	 * 订单状态(0-创建，1-订单完成， 2-取消, 3 - 已接单 , 4-用户删除,5 卖家已发货 )
	 */
	private Integer status;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	@JSONField(format = "yyyy-MM-dd HH:mm")
	private Date createTime;//创建时间
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	@JSONField(format = "yyyy-MM-dd HH:mm")
	private Date updateTime;//创建时间
	private BigDecimal totalAmount;//总金额
	/**
	 * 支付方式(0-支付宝，1-微信)
	 */
	private Integer paymentMethod;
	private String gameServer;//游戏区服
	private String gameUserName;//收货角色
	private String gameUserLevel;//游戏角色等级
	private String phone;//收货人手机号
	private String notes;//备注
	/**
	 * 支付状态(0-未支付，1-已支付，2-取消支付) 3已退款
	 */
	private Integer paymentStatus;
	private Date paymentTime;//支付时间
	private String transactionId;//交易流水号(第三方支付平台返回)

	@TableField(exist = false)
	private List<OrderItem> orderItems;
	@TableField(exist = false)
	private String itemDesc;
	@TableField(exist = false)
	//类型 1 购买 2出售
	private String prop;
	@TableField(exist = false)
	private String userName;
	@TableField(exist = false)
	private String tel;
	@TableField(exist = false)
	private Long unreadCount;
	private BigDecimal rate;

	private String saleId;
	private String payAccount;

	private String refundId;

	private Integer readStatus;
	private Integer openStatus;


	private Integer isDel;

	private String remark;

}
